import type { CategoryDetail, CategoryResult, CategoryTopItem } from '@/types/category'
import { http } from '@/utils/http'

/**
 * 分类列表-小程序
 */
export const getCategoryTopAPI = () => {
  return http<CategoryTopItem[]>({
    method: 'GET',
    url: '/category/top',
  })
}
/* 获取修改的分类列表 - tabBar下的分类页面 */
export const getCategoryAPI = () => {
  return http<CategoryResult>({
    method: 'GET',
    url: '/shop/category',
  })
}
/* 对分类列表进行增加 */
export const addCategoryAPI = (data = {}) => {
  return http({
    method: 'POST',
    url: '/shop/category',
    data,
  })
}
/* 获取对应分类的商品数据 */
export const getCategoryDetailAPI = (data = {}) => {
  return http<CategoryDetail>({
    method: 'GET',
    url: '/shop/meal',
    data,
  })
}
